package astudy.tree.impl;

import astudy.tree.TreeNode;

@SuppressWarnings("unchecked")
public class BinaryTreeNode<T extends Comparable> implements TreeNode<T> {
	
	protected BinaryTreeNode<T> left;
	protected BinaryTreeNode<T> right;
	protected T value;
	
	public BinaryTreeNode(T value) {
		this.value = value;
		this.left = null;
		this.right = null;
	}
	
	public BinaryTreeNode(T value, BinaryTreeNode<T> left, BinaryTreeNode<T> right) {
		this.value = value;
		this.left = left;
		this.right = right;
	}

	public BinaryTreeNode<T> getLeft() {
		return left;
	}

	public void setLeft(BinaryTreeNode<T> left) {
		this.left = left;
	}

	public BinaryTreeNode<T> getRight() {
		return right;
	}

	public void setRight(BinaryTreeNode<T> right) {
		this.right = right;
	}

	public T getValue() {
		return value;
	}

	public void setValue(T value) {
		this.value = value;
	}
}
